/*
 * @Description: 入口文件 `main`
 * @Author: smellycat littlecandyi@163.com
 * @Date: 2025-04-12 22:07:03
 * @LastEditors: smellycat littlecandyi@163.com
 * @LastEditTime: 2025-04-13 00:40:54
 */

import { StrictMode } from 'react'
import { createRoot } from 'react-dom/client'
import { RouterProvider, createRouter } from '@tanstack/react-router'
import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'

import { routeTree } from '#/routeTree.gen'

// import App from './App.tsx'

import '@unocss/reset/tailwind-compat.css'
import 'virtual:uno.css'
import './styles/main.css'

const router = createRouter({ routeTree })

declare module '@tanstack/react-router' {
	interface Register {
		router: typeof router
	}
}

const rootElement = document.querySelector('#root')!

if (!rootElement.innerHTML) {
	createRoot(rootElement).render(
		<StrictMode>
			<RouterProvider router={router} />
			<TanStackRouterDevtools router={router} />
		</StrictMode>
	)
}
